package com.laizhenghua.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @description:
 * @date: 2022/1/3 19:37
 */
@RestController
@RequestMapping(value = "/consumer")
public class OrderController {
    public static final String INVOKE_URL = "http://cloud-consul-payment8004";
    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping(value = "/hello")
    public String invokePaymentHelloMethod() {
       return restTemplate.getForObject(INVOKE_URL + "/payment/hello", String.class);
    }
}
